package cn.meizhu.pay.service.impl;

import cn.meizhu.base.canstant.PayCanstant;
import cn.meizhu.base.service.impl.BaseServiceImpl;
import cn.meizhu.pay.domain.PayAlipayInfo;
import cn.meizhu.pay.domain.PayBill;
import cn.meizhu.pay.mapper.PayAliPayInfoMapper;
import cn.meizhu.pay.service.IPayAliPayInfoService;
import cn.meizhu.util.PayAliPayUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class PayAliPayInfoServiceImpl extends BaseServiceImpl<PayAlipayInfo> implements IPayAliPayInfoService {

    @Autowired
    private PayAliPayInfoMapper payAliPayInfoMapper;


    @Override
    public String pay(PayBill payBill) {
        switch (payBill.getPayChannel()){
            case PayCanstant.ALIPAY:
                PayAlipayInfo alipayInfo = payAliPayInfoMapper.findById(1L);
                return PayAliPayUtil.pay(alipayInfo,payBill);
            case PayCanstant.WXIPAY:

                break;

            case PayCanstant.YLPAY:

                break;

        }
        return "";
    }
}
